<?php
/**
 * @var $model User
 * @var $this UserController
 */
$this->breadcrumbs = array(
    'Tài khoản' => array('profile'),
    "Thay đổi mật khẩu",
);
$this->pageTitle = Yii::app()->user->name." | Thay đổi mật khẩu";
?>

<div class="form">
    <h2 style="background:#EFB632;color: #000;padding: 3px 0px 3px 20px;font-size: 13px;font-weight: bold">Thay đổi mật
        khẩu</h2>

    <?php if (Yii::app()->user->hasFlash('changepass')): ?>

    <div class="flash-success">
        <?php echo Yii::app()->user->getFlash('changepass'); ?>
    </div>

    <?php else: ?>

    <?php
    /**
     * @var $form CActiveForm
     */
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'user-form',
        'enableAjaxValidation' => true,
    ));
    ?>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model, 'old_password'); ?>
        <?php echo $form->passwordField($model, 'old_password', array('size' => 60, 'maxlength' => 150)); ?>
        <?php echo $form->error($model, 'old_password'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'new_password'); ?>
        <?php echo $form->passwordField($model, 'new_password', array('size' => 60, 'maxlength' => 150)); ?>
        <?php echo $form->error($model, 'new_password'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'confirm_new_password'); ?>
        <?php echo $form->passwordField($model, 'confirm_new_password', array('size' => 60, 'maxlength' => 150)); ?>
        <?php echo $form->error($model, 'confirm_new_password'); ?>
    </div>
    <div class="row buttons">
        <?php echo CHtml::submitButton('Lưu'); ?>
    </div>
    <?php $this->endWidget(); ?>
    <?php endif ?>
</div>